import request from '@/utils/request'

// 获得管理员列表
export function getManagerList() {
  return request({
    url: '/administrator/all',
    method: 'get'
  })
}

// 修改或新增管理员
export function updateManage(data) {
  return request({
    url: '/administrator/me',
    method: 'put',
    data
  })
}

// 删除管理员
export function deleteManage(data) {
  return request({
    url: `/administrator/${data}`,
    method: 'delete',
  })
}

// 查询学生列表
export function getStudentList(params) {
  return request({
    url: `/administrator/student/all`,
    method: 'get',
    params
  })
}

// 删除学生信息
export function deleteStudent(data) {
  return request({
    url: `/administrator/student/${data}`,
    method: 'delete',
  })
}

// 修改学生信息
export function updateStudent(data) {
  return request({
    url: '/administrator/student/me',
    method: 'put',
    data
  })
}

// 查询教师信息
export function getTeacherList(params) {
  return request({
    url: `/administrator/teacher/me`,
    method: 'get',
    params
  })
}

// 删除教师信息
export function deleteTeacher(data) {
  return request({
    url: `/administrator/teacher/${data}`,
    method: 'delete',
  })
}

// 更新教师信息
export function updateTeacher(data) {
  return request({
    url: '/administrator/teacher/me',
    method: 'put',
    data
  })
}
